<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../org/angular.min.js"></script>
</head>
<body>
<div ng-app="hd" ng-controller="ctrl">
    <ul>
        <!--{{$first}}第一个 {{$last}}最后一个 {{$middle}}中间的 {{$even}}偶数的 {{$odd}}奇数的 -->
        <li ng-repeat="(k,v) in data" style="{{$first?'color:red':''}}">
            名称: {{v.name}} 网址: {{v.url}}
        </li>
        <hr/>
        <li ng-repeat="(k,v) in data">
            <span style="{{!$middle?'color:red':''}}">名称: {{v.name}} 网址: {{v.url}}</span>
        </li>
    <ul/>
        <ul>
            <li ng-repeat="v in data1 track by $index">
                {{v}}
            </li>
        </ul>
</div>


<script>
    var m = angular.module('hd', []);
    m.controller('ctrl', ['$scope', function ($scope) {
        $scope.data = [
            {name: '后盾人', url: 'houdunren.com'},
            {name: '后盾网', url: 'houdunwang.com'},
            {name: '后盾云', url: 'houdunyun.com'},
            {name: 'hdphp', url: 'hdphp.com'},
            {name: 'hdcms', url: 'hdcms.com'}
        ];

        $scope.data1 = ['后盾人', '后盾网', '后盾云', 'hdphp', 'hdcms' , 'hdcms'];
    }]);
</script>

</body>
</html>

